//获取应用实例
const app = getApp();
// 引入AES.js
var baseJs = require("../../common/base.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 
    uid: "",
   xinaJin:"",
   preXianJin:"",
  },


  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.setData({
      uid: wx.getStorageSync('uid'),
    })
    this.GetUserInfoByIDs();
  },
  // 
  GetUserInfoByIDs:function(){
    var that = this;
    var uid = this.data.uid;
    var xianJin = this.data.xianJin;
    var preXianJin = this.data.preXianJin;
    wx.request({
      url: baseJs.api + baseJs.encryUrl("method=GetUserInfoByIDs&UID=" + uid),
      success: function (res) {
        var json = JSON.parse(baseJs.decryUrl(res.data));
        xianJin = parseFloat(json.ResultData.MyRMB).toFixed(2);
        preXianJin = parseFloat(json.ResultData.PrestoreCash).toFixed(2);
        that.setData({
          xianJin: xianJin,
          preXianJin: preXianJin,
        })
      }
    })
  }
  // 
})